package com.example.goodsmanagementcabinet.base;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;

import com.example.goodsmanagementcabinet.otto.OttoManager;
import com.example.goodsmanagementcabinet.utils.Utils;

public class BaseDialogFragment extends DialogFragment {

    public Activity mActivity;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Utils.hideVirtualKey(getDialog().getWindow().getDecorView());
        OttoManager.getInstance().onSubscribe(this);
        mActivity = getActivity();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        OttoManager.getInstance().offSubscribe(this);
    }
}
